use "/Users/jimgolby/Desktop/ZB - Confidence Book/Technical Appendix/Data Files/Wave 1 Weighted.dta"
cd "/Users/jimgolby/Desktop/ZB - Confidence Book/Technical Appendix/Chapter 10/TA Files"

***Defining Variables (Wave 1)***
replace q12i =. if q12i == 98
replace q12j =. if q12j == 98

generate q12i2 = 0
replace q12i2 = 1 if q12i < 3
generate q12j2 = 0
replace q12j2 = 1 if q12j > 0.5 & q12j < 1.1

generate q8a = .
replace q8a = 0
replace q8a = 1 if q8 < 3

replace q8 = . if q8 > 6
replace q8 = q8 * -1

label define CONFIDENCE 0 "Not Confident" 1 "Confidence"
label values q8a CONFIDENCE

generate pid3 =.
replace pid3 = 1 if partyid7 < 4
replace pid3 = 2 if partyid7 == 4
replace pid3 = 3 if partyid7 > 4

label define PARTY 1 "Democrats" 2 "Independents" 3 "Republicans"
label values pid3 PARTY

generate dem = 0 if pid3 < 4
replace dem = 1 if pid3 == 1
generate rep = 0 if pid3 < 4
replace rep = 1 if pid3 == 3
generate ind = 0 if pid3 < 4
replace ind = 1 if pid3 == 2

generate ideo3 =.
replace ideo3 = 1 if ideo < 4
replace ideo3 = 2 if ideo == 4
replace ideo3 = 3 if ideo > 4 & ideo < 8

generate ideo3a = ideo3
replace ideo3a = 4 if ideo == 8

gen lib = 0
replace lib = 1 if ideo3 == 1
gen mod = 0
replace mod = 1 if ideo3 == 2
gen con = 0
replace con = 1 if ideo3 == 3

generate woman = 0
replace woman = 1 if gender == 2
generate male = 0
replace male = 1 if gender == 1

gen vet = veteran if veteran < 98
replace vet = 0 if veteran == 2
replace vet = 0 if veteran2 == 1
replace vet =. if veteran2 == 98

gen activeduty = 0 if veteran < 98
replace activeduty =. if veteran2 == 98
replace activeduty = 1 if veteran2 == 1

generate milvet= 0
replace milvet = 1 if vet == 1
replace milvet = 2 if activeduty == 1

generate post911vet = 0
replace post911vet = 1 if milvet > 0 & vet_date1 < 2001
replace post911vet = 2 if milvet > 0 & vet_date1 > 2000

generate social = 0 if q45 < 98
replace social = 1 if q45 == 1

generate family = 0 if q46 < 98
replace family = 1 if q46 == 1
replace family = . if q46b_dk == 1

generate religion = 0 if relig < 98
replace religion = 1 if relig == 1
replace religion = 2 if relig == 2
replace religion = 3 if relig > 8 & relig < 12
replace religion = 1 if relig == 12

label define RELIGION2 0 "Other" 1 "Christian" 2 "Catholic" 3 "None"
label values religion RELIGION2

generate christian = 0
replace christian = 1 if religion == 1
generate catholic = 0
replace catholic = 1 if religion == 2
generate norelig = 0
replace norelig = 1 if religion == 3

generate white = 0
replace white = 1 if racethnicity == 1
generate black = 0
replace black = 1 if racethnicity == 2
replace black = 1 if racethnicity == 3
generate hispanic = 0
replace hispanic = 1 if racethnicity == 4
generate asian = 0
replace asian = 1 if racethnicity == 6

gen race2 = racethnicity
replace race2 =. if racethnicity == 3
replace race2 =. if racethnicity == 5

label define RACE 1 "White" 2 "Black" 4 "Hispanic" 6 "Asian"
label values race2 racethnicity RACE

generate generation =.
replace generation = 1 if age > 73
replace generation = 2 if age > 54 & age < 74
replace generation = 3 if age > 38 & age < 55
replace generation = 4 if age > 22 & age < 39
replace generation = 5 if age < 23

generate silent = 0
replace silent = 1 if generation == 1
generate boomer = 0
replace boomer = 1 if generation == 2
generate genx = 0
replace genx = 1 if generation == 3
generate milen = 0
replace milen = 1 if generation == 4
generate genz = 0
replace genz = 1 if generation == 5

generate northeast = 0
replace northeast = 1 if region4 == 1
generate midwest = 0
replace midwest = 1 if region4 == 2
generate south = 0
replace south = 1 if region4 == 3 
generate west = 0
replace west = 1 if region4 == 4 

generate city = 0
replace city = 1 if urban3 == 1
generate suburban = 0
replace suburban = 1 if urban3 == 2
generate rural = 0
replace rural = 1 if urban3 == 3

generate unemployed = 0 if employ < 3
replace unemployed = 1 if employ > 2
replace unemployed = 0 if employ == 5

generate income5 =.
replace income5 = 1 if income < 5
replace income5 = 2 if income > 4 & income < 9
replace income5 = 3 if income > 8 & income < 12
replace income5 = 4 if income > 11 & income < 15
replace income5 = 5 if income > 14

gen married =.
replace married = 1 if marital == 1
replace married = 0 if marital > 1

replace q14=. if q14 > 76
replace age=. if age == 286

generate q82a = q8a
recode q82a (0=1)(1=0)

generate q19h2 = .
replace q19h2 = 0 if q19h < 77
replace q19h2 = -1 if q19h < 3
replace q19h2 = 1 if q19h > 3 & q19h < 77

generate q19ah2 = .
replace q19ah2 = 0 if q19ah < 77
replace q19ah2 = -1 if q19ah < 3
replace q19ah2 = 1 if q19ah > 3 & q19ah < 77


generate q33ac2 = .
replace q33ac2 = 0 if q33ac < 77
replace q33ac2 = 1 if q33ac < 3
replace q33ac2 = -1 if q33ac > 3 & q33ac < 77

generate q33c2 = .
replace q33c2 = 0 if q33c < 77
replace q33c2 = 1 if q33c < 3
replace q33c2 = -1 if q33c > 3 & q33c < 77


generate q33ad2 = .
replace q33ad2 = 0 if q33ad < 77
replace q33ad2 = 1 if q33ad < 3
replace q33ad2 = -1 if q33ad > 3 & q33ad < 77

generate q42a2 = .
replace q42a2 = 0 if q42a < 77
replace q42a2 = 1 if q42a < 3

generate q42b2 = .
replace q42b2 = 0 if q42b < 77
replace q42b2 = 1 if q42b < 3

generate Q28AA = .
replace Q28AA = 0 if q28aa < 98
replace Q28AA = 1 if q28aa == 1

generate Q28A = .
replace Q28A = 0 if q28a < 98
replace Q28A = 1 if q28a == 1

generate Q28B = .
replace Q28B = 0 if q28b < 98
replace Q28B = 1 if q28b == 1

generate Q28AB = .
replace Q28AB = 0 if q28ab < 98
replace Q28AB = 1 if q28ab == 1

label define BI2 0 "Don't Agree" 1 "Agree"
label values q42a2 q42b2 BI2

label define CONFIDENT 1 "A Great Deal" 2 "Quite a Lot" 3 "Some" 4 "Almost None"
label values q8 CONFIDENT
label define CONFIDENCE1 0 "Conf" 1 "NotConf"
label values q82a CONFIDENCE1
label define TRI -1 "Agree" 0 "Neither" 1 "Disagr"
label values q33c2 q33ac2 q33ad2 TRI
label values q19h2 q19ah2 TRI
label define YN 1 "Yes" 2 "No" 3 "Don't Know" 77 "Don't Know'"
label values q44 q46 q47 YN
label define veteran 1 "Veteran" 2 "Civilian"
label values veteran veteran

label define PID3 1 "Democrat" 2 "Independent" 3 "Republican"
label values pid3 PID3

gen educ5 = educ4
replace educ5 = 5 if educ > 12 & educ < 15

generate q19ag2 = .
replace q19ag2 = 1 if q19ag < 3
replace q19ag2 = 0 if q19ag > 2 & q19ag < 77
generate q33d2 = .
replace q33d2 = 1 if q33d < 3
replace q33d2 = 0 if q33d > 2 & q33d < 77
generate q33e2 = .
replace q33e2 = 1 if q33e < 3
replace q33e2 = 0 if q33e > 2 & q33e < 77
generate q33f2 = .
replace q33f2 = 1 if q33f < 3
replace q33f2 = 0 if q33f > 2 & q33f < 77
generate q33h2 = .
replace q33h2 = 1 if q33h < 3
replace q33h2 = 0 if q33h > 2 & q33h < 77
generate q33af2 = .
replace q33af2 = 1 if q33f < 3
replace q33af2 = 0 if q33f > 2 & q33f < 77

generate q19aa2 = .
replace q19aa2 = 1 if q19aa < 3
replace q19aa2 = 0 if q19aa > 2 & q19aa < 77
generate q19ab2 = .
replace q19ab2 = 1 if q19ab < 3
replace q19ab2 = 0 if q19ab > 2 & q19ab < 77
generate q19ad2 = .
replace q19ad2 = 1 if q19ad < 3
replace q19ad2 = 0 if q19ad > 2 & q19ad < 77
generate q19d2 = .
replace q19d2 = 1 if q19d < 3
replace q19d2 = 0 if q19d > 2 & q19d < 77
generate q19ae2 = .
replace q19ae2 = 1 if q19ae < 3
replace q19ae2 = 0 if q19ae > 2 & q19ae < 77
generate q19e2 = .
replace q19e2 = 1 if q19e < 3
replace q19e2 = 0 if q19e > 2 & q19e < 77

label define BI 0 " Do Not Agree" 1 "Agree"
label values q19aa2 q19ab2 q19d2 q19ad2 q19ae2 q19e2 BI
************************************

***Table 10.1 (Rows 1-2)***
eststo: quietly reg q12i2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q12j2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

***esttab est1 est2 using tab101a.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))

***Table 10.3 (Rows 1-6)***
tab q19ag2 q8 if q8 < 77 [aweight=weight],column
tab q33d2 q8 if q8 < 77 [aweight=weight],column
tab q33e2 q8 if q8 < 77 [aweight=weight],column
tab q33f2 q8 if q8 < 77 [aweight=weight],column
tab q33h2 q8 if q8 < 77 [aweight=weight],column
tab q33af2 q8 if q8 < 77 [aweight=weight],column

eststo: quietly reg q19ag2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q33d2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q33e2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

***esttab est3 est4 est5 using tab103a1.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))
*************

eststo: quietly reg q33f2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q33h2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q33af2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

***esttab est6 est7 est8 using tab103a2.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))

***esttab est3 est4 est5 est6 est7 est8 using tab103a.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))

*****************************

*****Table 10.5 (Rows 2,4,6-9)*****

eststo: quietly reg q19aa2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q19ab2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q19d2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

***esttab est9 est10 est11 using tab105a1.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))
*************

eststo: quietly reg q19ad2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q19ae2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

eststo: quietly reg q19e2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight]

***esttab est12 est13 est14 using tab105a2.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))

esttab est9 est10 using app41a.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 41a: Attitudes about the Military Role in Policymaking and Confidence }) mtitle("Should Not Criticize Civilians" "Proper to Advocate") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" Christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")

esttab est11 est12 est13 est14 using app41b.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 41b: Attitudes about the Military Role in Policymaking and Confidence }) mtitle("Civilians Should Decide to Use Force" "Military Should Run the War" "Military Leaders Do Not Have Enough Influence" "A System of Military Rule Would be Good") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" Christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")


clear 
use "/Users/jimgolby/Desktop/ZB - Confidence Book/Technical Appendix/Data Files/Wave 2.dta"

***Define Demographic Variables***

generate PID3 =.
replace PID3 = 1 if PARTYID < 4
replace PID3 = 2 if PARTYID == 4
replace PID3 = 3 if PARTYID > 4 & PARTYID < 8 

gen DEM = 0 if PID3 > 0
replace DEM = 1 if PID3 == 1
gen REP = 0 if PID3 > 0
replace REP = 1 if PID3 == 3

gen IDEO3 = .
replace IDEO3 = 1 if IDEO < 4
replace IDEO3 = 2 if IDEO == 4
replace IDEO3 = 3 if IDEO > 4 & IDEO < 8

label define LIBCONV3 0 "None" 1 "Liberal" 2 "Moderate" 3 "Conservative"
label values IDEO3 LIBCONV3 

label define PID3 1 "Dem" 2 "Ind" 3 "Rep"
label values PID3 PID3

replace Q11 =. if Q11 == 98

generate CONF4 = Q11 * (-1)

replace VETERAN =. if VETERAN == 98
replace VETERAN2 =. if VETERAN2 == 98
gen VET = VETERAN * (-1)

generate MILVET =.
replace MILVET = 0 if VETERAN > 1 & VETERAN < 77
replace MILVET = 1 if VETERAN == 1
replace MILVET = 2 if VETERAN == 1 & VETERAN_RES == 1

label define MILVET 0 "Civilian" 1 "Veteran" 2 "NG/Reserve Vet"
label values MILVET MILVET

generate Post911 =.
replace Post911 = 0 if VETERAN == 1 & VETERAN4 == 1
replace Post911 = 1 if VETERAN == 1 & VETERAN4 > 1 & VETERAN4 == 2
replace Post911 = 0 if VETERAN == 1 & VETERAN4 > 1 & VETERAN4 == 3

label define Post911 0 "Served Before 9/11" 1 "Served After 9/11"
label values Post911 Post911

generate Q11T =.
replace Q11T = 0 if Q11 > 2
replace Q11T = 1 if Q11 < 3

label define Confidence 0 "Not Confident" 1 "Confident"
label values Q11T Confidence

gen WOMAN = GENDER - 1

gen MALE = 0
replace MALE = 1 if GENDER == 1

gen ACTIVEDUTY = 0 if VETERAN < 98
replace ACTIVEDUTY = . if VETERAN2 == 98
replace ACTIVEDUTY = 1 if VETERAN2 == 1

generate FAMILY = 0 if Q39 < 77
replace FAMILY = 1 if Q39 == 1

gen SOCIAL = 0 if Q38 < 98
replace SOCIAL = 1 if Q38 == 1

replace URBAN3 =. if URBAN3 < 1

generate white = 0
replace white = 1 if RACE == 1
generate black = 0
replace black = 1 if RACE == 2
replace black = 1 if RACE == 3
generate hispanic = 0
replace hispanic = 1 if RACE == 4
generate asian = 0
replace asian = 1 if RACE == 6

gen RACE2 = RACE if RACETHNICITY < 77
replace RACE2 =. if RACETHNICITY == 3
replace RACE2 = 2 if RACETHNICITY == 5

label define RACE 1 "White" 2 "Black" 4 "Hispanic" 6 "Asian"
label values RACE2 RACE

generate generation =.
replace generation = 1 if AGE > 73
replace generation = 2 if AGE > 54 & AGE < 74
replace generation = 3 if AGE > 38 & AGE < 55
replace generation = 4 if AGE > 22 & AGE < 39
replace generation = 5 if AGE < 23

label define GENERATION 1 "Silent" 2 "Boomer" 3 "Gen X" 4 "Millennial" 5 "Gen Z"
label values generation GENERATION

generate silent = 0
replace silent = 1 if generation == 1
generate boomer = 0
replace boomer = 1 if generation == 2
generate genx = 0
replace genx = 1 if generation == 3
generate milen = 0
replace milen = 1 if generation == 4
generate genz = 0
replace genz = 1 if generation == 5

gen EDUC3 = . if EDUC5 > 5
replace EDUC3 = 1 if EDUC5 < 3
replace EDUC3 = 2 if EDUC5 == 3
replace EDUC3 = 2 if EDUC5 == 4
replace EDUC3 = 3 if EDUC5 == 5

generate INCOME5 =.
replace INCOME5 = 1 if INCOME < 5
replace INCOME5 = 2 if INCOME > 4 & INCOME < 9
replace INCOME5 = 3 if INCOME > 8 & INCOME < 12
replace INCOME5 = 4 if INCOME > 11 & INCOME < 15
replace INCOME5 = 5 if INCOME > 14

gen midwest = 0
replace midwest = 1 if REGION4 == 2
gen south = 0
replace south = 1 if REGION4 == 3
gen west = 0
replace west = 1 if REGION4 == 4

generate religion = 0 if RELIG < 98
replace religion = 1 if RELIG == 1
replace religion = 2 if RELIG == 2
replace religion = 3 if RELIG > 8 & RELIG < 12
replace religion = 1 if RELIG == 12

generate christian = 0
replace christian = 1 if religion == 1
generate catholic = 0
replace catholic = 1 if religion == 2
generate norelig = 0
replace norelig = 1 if religion == 3

gen married =.
replace married = 1 if MARITAL == 1
replace married = 0 if MARITAL > 1

generate unemployed = 1 if EMPLOY < 3
replace unemployed = 0 if EMPLOY > 2

generate city = 0
replace city = 1 if URBAN3 == 1
generate rural = 0
replace rural = 1 if URBAN3 == 3

gen VET2 = 0 if VETERAN < 77
replace VET2 = 1 if VETERAN2 == 1

generate Post911civ =.
replace Post911civ = 0 if VETERAN > 1 & VETERAN < 77
replace Post911civ = 2 if VETERAN == 1 & VETERAN4 == 2

replace Post911civ = 1 if VETERAN == 1 & VETERAN4 == 1
replace Post911civ = 1 if VETERAN == 1 & VETERAN4 == 3

generate Q3A2 = .
replace Q3A2 = 1 if Q3A < 3
replace Q3A2 = 0 if Q3A > 2 & Q3A < 77
generate Q3B2 = .
replace Q3B2 = 1 if Q3B < 3
replace Q3B2 = 0 if Q3B > 2 & Q3B < 77
generate Q4C2 = .
replace Q4C2 = 1 if Q4C < 3
replace Q4C2 = 0 if Q4C > 2 & Q4C < 77
generate Q4AC2 = .
replace Q4AC2 = 1 if Q4AC < 3
replace Q4AC2 = 0 if Q4AC > 2 & Q4AC < 77

gen q8a = Q11T 
gen dem = DEM 
gen rep = REP 
gen ideo3 = IDEO3 
gen male = MALE 
gen activeduty = ACTIVEDUTY
gen vet = VET 
gen social = SOCIAL
gen family = FAMILY
gen educ5 = EDUC5
gen income5 = INCOME5
gen q8 = CONF4

************************************
*****Table 10.1 (Rows 3-6)*****
eststo: quietly reg Q3A2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight2]

eststo: quietly reg Q3B2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight2]

eststo: quietly reg Q4C2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight2]

eststo: quietly reg Q4AC2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married [pweight = weight2]

esttab est1 est2 est15 est16 using app38a.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 38a: Responses to Privilege Questions and Level of Confidence in the Military}) mtitle("Airports and Restaurants" "Civilian Jobs" "Should Say TYFYS" "TYFYS Makes it Harder") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")

esttab est17 est18 using app38b.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 38b: Responses to Medical Privilege Questions and Level of Confidence in the Military}) mtitle("Doctors and Nurses Should" "Doctors and Nurses Should Not") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")

*****Table 10.2*****
by Post911civ, sort: tab Q3A2 Q11 if Q11 < 77 [aweight=weight2], column
by Post911civ, sort: tab Q3B2 Q11 if Q11 < 77 [aweight=weight2], column

eststo: quietly reg Q3A2 CONF4 DEM REP IDEO3 MALE FAMILY SOCIAL catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Post911civ == 0 [pweight = weight2]

eststo: quietly reg Q3A2 CONF4 DEM REP IDEO3 MALE FAMILY SOCIAL catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Post911civ == 1 [pweight = weight2]

eststo: quietly reg Q3A2 CONF4 DEM REP IDEO3 MALE FAMILY SOCIAL catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Post911civ == 2 [pweight = weight2]

***esttab est19 est20 est21 using tab102a1.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))

eststo: quietly reg Q3B2 CONF4 DEM REP IDEO3 MALE FAMILY SOCIAL catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Q11 < 5 & Post911civ == 0 [pweight = weight2]

eststo: quietly reg Q3B2 CONF4 DEM REP IDEO3 MALE FAMILY SOCIAL catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Q11 < 5 & Post911civ == 1 [pweight = weight2]

eststo: quietly reg Q3B2 CONF4 DEM REP IDEO3 MALE FAMILY SOCIAL catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Q11 < 5 & Post911civ == 2 [pweight = weight2]

***esttab est22 est23 est24 using tab102a2.rtf, se ar2 replace label nogap onecell cells(b(star fmt(2)) se(par))

esttab est19 est20 est21 using app39a.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 39a: Responses to All Americans Should Say TFYS to Members of the Military when They Meet and Veteran Status and Confidence}) se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                                                         *p<0.1; **p<0.05; ***p<0.01}) mtitle("Civilian" "Pre-9/11 Veteran" "Post-9/11 Veteran") coeflabels(CONF4 "Confidence" DEM "Democrat" REP "Republican" IDEO3 "Ideology" MALE "Male" SOCIAL "Social Contact" FAMILY "family" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" EDUC5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" INCOME5 "Income" married "Married")

esttab est22 est23 est24 using app39b.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 39b: TYFYS Can Make it Harder to Have a Real Conversation and Veteran Status and Confidence}) se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                                                         *p<0.1; **p<0.05; ***p<0.01}) mtitle("Civilian" "Pre-9/11 Veteran" "Post-9/11 Veteran") coeflabels(CONF4 "Confidence" DEM "Democrat" REP "Republican" IDEO3 "Ideology" MALE "Male" SOCIAL "Social Contact" FAMILY "family" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" EDUC5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" INCOME5 "Income" married "Married")

************************************

***Define Variables (Wave 2)***
generate Q4A2 = .
replace Q4A2 = 1 if Q4A < 3
replace Q4A2 = 0 if Q4A > 2 & Q4A < 77
generate Q4AA2 = .
replace Q4AA2 = 1 if Q4AA < 3
replace Q4AA2 = 0 if Q4AA > 2 & Q4AA < 77
generate Q3AA2 = .
replace Q3AA2 = 0 if Q3AA < 3
replace Q3AA2 = 1 if Q3AA == 3
replace Q3AA2 = 2 if Q3AA > 3 & Q3AA < 77

label define TRI 0 "Agree" 1 "Neither" 2 "Agree"
label values Q3AA2 TRI

************************************
*****Table 10.3 (Rows 7-9)*****
tab Q4A2 Q11 if Q11 < 77 [aweight=weight2], column
tab Q4AA2 Q11 if Q11 < 77 [aweight=weight2], column
tab Q3AA2 Q11 if Q11 < 77 [aweight=weight2], column

eststo: quietly reg Q4A2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Q11 < 5 [pweight = weight2]

eststo: quietly reg Q4AA2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Q11 < 5 [pweight = weight2]

eststo: quietly reg Q3AA2 q8 dem rep ideo3 male activeduty vet family social catholic christian norelig white black hispanic asian educ5 boomer genx milen genz midwest south west city rural unemployed income5 married if Q11 < 5 [pweight = weight2]

esttab est3 est4 est5 using app40a.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 40a: Public Pedestalizing of the Military and Confidence Level}) mtitle("Military Leaders Care More" "Respect Service More" "Make Society More Moral") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")

esttab est6 est7 using app40b.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 40b: Public Pedestalizing of the Military and Confidence Level}) mtitle("Military More Like Society" "Should Stand for Anthem") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")

esttab  est8 est25 est26 est27 using app40c.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 40c: Public Pedestalizing of the Military and Confidence Level}) mtitle("Military Gets More Respect than it Deserves 2019" "Military Gets More Respect than it Deserves 2020" "Military Gets Less Respect than it Deserves 2020" "Civilians Who Don't Volunteer Should Feel Guilty") se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                     *p<0.1; **p<0.05; ***p<0.01}) coeflabels(q8 "Confidence" dem "Democrat" rep "Republican" ideo3 "Ideology" male "Male" activeduty "Active Duty" vet "Veteran" family "Family" social "Social Contact" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" educ5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" income5 "Income" married "Married")

*****Table 10.4*****
gen Post911civ1 =.
replace Post911civ1 = 0 if Post911civ == 0
replace Post911civ1 = 1 if Post911civ == 1

gen Post911civ2 =.
replace Post911civ2 = 0 if Post911civ == 0
replace Post911civ2 = 1 if Post911civ == 2

gen Post911mil =.
replace Post911mil = 0 if Post911civ == 1
replace Post911mil = 1 if Post911civ == 2

*****Table 10.4*****
mean Q3AA2 [pweight = weight2], over(Post911civ)

svyset [pw=weight2], strata(VETERAN) 

svy: mean Q3AA2, over(Post911civ1) coeflegend cformat(%9.2f)

test _b[c.Q3AA2@0bn.Post911civ1] = _b[c.Q3AA2@1.Post911civ1]

svy: mean Q3AA2, over(Post911civ2) coeflegend cformat(%9.2f)

test _b[c.Q3AA2@0bn.Post911civ2] = _b[c.Q3AA2@1.Post911civ2]

svy: mean Q3AA2, over(Post911mil) coeflegend cformat(%9.2f)

test _b[c.Q3AA2@0bn.Post911mil] = _b[c.Q3AA2@1.Post911mil]

**************************

***Table 10.8***

replace Q20A_0 = . if Q20A_0 > 5
replace Q20A_0 = Q20A_0 * -1
replace Q20B_0 = . if Q20B_0 > 5
replace Q20B_0 = Q20B_0 * -1
replace Q20C_0 = . if Q20C_0 > 5
replace Q20C_0 = Q20C_0 * -1

replace Q3AB = . if Q3AB > 5
replace Q3AB = Q3AB * -1

tab Q20A_0 Q11T if Q11 < 77 [aweight=weight2], column
tab Q20B_0 Q11T if Q11 < 77 [aweight=weight2], column
tab Q20C_0 Q11T if Q11 < 77 [aweight=weight2], column
tab Q3AB Q11T if Q11 < 77 [aweight=weight2], column

eststo: quietly reg Q20A_0 CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 & Q20A_0 < 6 [pweight = weight2], cformat(%3.2f)

eststo: quietly reg Q20B_0 CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 & Q20B_0 < 6 [pweight = weight2]

eststo: quietly reg Q20C_0 CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 & Q20C_0 < 6 [pweight = weight2]

eststo: quietly reg Q3AB CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 & Q3AB < 6 [pweight = weight2]

esttab est28 est29 est30 est31 using app42.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 42: Public Views on Criticism of the Military and Confidence}) se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                                                         *p<0.1; **p<0.05; ***p<0.01}) mtitle("Criticism is Unpatriotic" "Criticism Helps our Enemies" "Criticism is Disrespectful" "Civilians Should not Question") coeflabels(CONF4 "Confidence" DEM "Democrat" REP "Republican" IDEO3 "Ideology" MALE "Male" ACTIVEDUTY "Active Duty" VET "Veteran" SOCIAL "Social Contact" FAMILY "family" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" EDUC5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" INCOME5 "Income" married "Married")

***Table 10.11***
generate Q24BT = .
replace Q24BT = 1 if Q24B < 3
replace Q24BT = 0 if Q24B > 2 & Q24B < 77
generate Q24CT = .
replace Q24CT = 1 if Q24C < 3
replace Q24CT = 0 if Q24C > 2 & Q24C < 77
generate Q24FT = .
replace Q24FT = 1 if Q24F < 3
replace Q24FT = 0 if Q24F > 2 & Q24F < 77

label define BI 0 "Do Not Agree" 1 "Agree"
label values Q24B Q24C Q24F BI

eststo: quietly reg Q24BT CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 [pweight = weight2]

eststo: quietly reg Q24CT CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 [pweight = weight2]

eststo: quietly reg Q24FT CONF4 DEM REP IDEO3 MALE ACTIVEDUTY VET FAMILY SOCIAL catholic christian norelig white black hispanic asian EDUC5 boomer genx milen genz midwest south west city rural unemployed INCOME5 married if Q11 < 5 [pweight = weight2]

esttab est32 est33 est34 using app43.rtf, ti ({\rtf1\ansi\deff0 {\fonttbl {\f0 Monotype Century;}} \f0\fs32\b Appendix 43: Perceptions of Military Leaders' Performance in Afghanistan and Confidence}) se stats(N r2, fmt(0 3)) replace label nogap onecell cells(b(star fmt(2)) se(par)) fonttbl(\f0\fnil Century;f1\fnil Century;) addnotes({\i Note:                                                         *p<0.1; **p<0.05; ***p<0.01}) mtitle("Implemented the Plan Well" "Gave Good Advice" "Did a Good Job Integrating") coeflabels(Q11T "Confidence" DEM "Democrat" REP "Republican" IDEO3 "Ideology" MALE "Male" ACTIVEDUTY "Active Duty" VET "Veteran" SOCIAL "Social Contact" FAMILY "family" catholic "Catholic" christian "Christian" norelig "No Religion" white "White" black "Black" hispanic "Hispanic" asian "Asian" EDUC5 "Education" boomer "Boomer" genx "Generation X" milen "Millennial" genz "Generation Z" midwest "Midwest" south "South" west "West" city "City" rural "Rural" unemployed "Unemployed" INCOME5 "Income" married "Married")
